{include file="public/header" /}
<?php $admin_uid=session('admin_uid');?>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>会员管理</cite></a>
              <a><cite>基本设置</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="x-body layui-card">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
              <ul class="layui-tab-title">
                {volist name="list" id="v"}
                  <li {if condition="$i eq 1"} class="layui-this"{/if}>{$v.title}</li>
                {/volist}
              </ul>
              <div class="layui-tab-content" >

                {volist name="list" id="v"}
                  <div class="layui-tab-item  {if condition='$i eq 1'} layui-show{/if}">
                      <form class="layui-form layui-form-pane" action="" method="post">
                          <?php
                                  $list2=db("config")->where("status=1 and uid=".$v['id'])->select();
                          $j=1;
                                    //print_r($list2);
                            ?>

                                  {volist name="list2" id="v2"}

                                      {if condition="$v2['vartype'] eq 0"}
                                          <div class="layui-form-item">
                                              <label class="layui-form-label">
                                                  {$v2.varinfo}
                                              </label>
                                              <div class="layui-input-inline">
                                                  <input type="text" name="{$v2.varname}" autocomplete="off" placeholder="" value="{$v2.varvalue}" class="layui-input">
                                              </div> <?php if($v2['varname']=='sys_ll'){?><a href="/admin/system/map" style="color:blue" target="_blank">获取经纬度</a><?php }?>
                                              {if condition="$admin_uid eq -1" }<font color="red"></font> 调用字段:sys('{$v2.varname}'){/if}
                                          </div>
                                      {elseif condition="$v2['vartype'] eq 1"/}
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">
                                                    {$v2.varinfo}
                                                </label>
                                                <div class="layui-input-block">
                                                    <textarea placeholder="" class="layui-textarea" name="{$v2.varname}"></textarea>
                                                </div>{if condition="$admin_uid eq -1" }<font color="red"></font> 调用字段:sys('{$v2.varname}'){/if}
                                            </div>
                                      {elseif condition="$v2['vartype'] eq 2"/}
                                          <div class="layui-form-item">
                                              <label class="layui-form-label">{$v2.varinfo}</label>
                                              <div class="layui-input-inline">
                                                  <input type="text" name="{$v2.varname}" id="{$v2.varname}" value="{$v2.varvalue}" class="layui-input">
                                              </div>
                                              <input type="button" id="sys_img{$j++}_btn" value="选择图片" class="layui-btn">
                                              {if condition="$admin_uid eq -1" }<font color="red"></font> 调用字段:sys('{$v2.varname}'){/if}
                                          </div>
                                      {elseif condition="$v2['vartype'] eq 3"/}

                                          <div class="layui-form-item">
                                              <label class="layui-form-label">{$v2.varinfo}</label>
                                              <div class="layui-input-inline">
                                                  <select name="{$v2.varname}">
                                                      <option value="">请选择</option>
                                                      <?php
                                                          $arr2=explode("|",$v2['varoption']);
                                                          for($i=0;$i<count($arr2);$i++){
                                                          $value2=$arr2[$i];
                                                          if($v2['varvalue']==$value2) $s=" selected";else $s="";
                                                          echo "<option value=\"$value2\"$s>$value2</option>";
                                                          }
                                                      ?>
                                                  </select>
                                              </div>
                                              {if condition="$admin_uid eq -1" }<font color="red"></font> 调用字段:sys('{$v2.varname}'){/if}
                                          </div>
                                      {/if}


                                  {/volist}


                          <div class="layui-form-item">
                              <button class="layui-btn" lay-submit="" lay-filter="*">
                                  保存
                              </button>
                          </div>
                      </form>
                      <div style="height:100px;"></div>
                  </div>
                {/volist}

              </div>
            </div> 
        </div>
        <script src="public/admin/lib/layui/layui.js" charset="utf-8"></script>
        <script>
            layui.use(['element','layer','form'], function(){
                $ = layui.jquery;//jquery
              layer = layui.layer;//弹出层
                var  form = layui.form;
            


              })
            </script>
            
    </body>
</html>
<style>
    .layui-form-pane .layui-form-text .layui-form-label{
        width: 80%;
    }
   .layui-input-block,.layui-form-text{
        width: 80%;
    }
</style>





<script>
    layui.use(['element','layer','form','upload'], function(){
        var  $ = layui.jquery;//jquery
        var lement = layui.element;//面包导航
        var layer = layui.layer;//弹出层
        var form = layui.form;
        var upload = layui.upload;

        //指定允许上传的文件类型
    <?php for($i=1;$i<10;$i++){?>
            upload.render({

                elem: '#sys_img<?php echo $i;?>_btn'
                ,url: '/admin/uploads/imgupload' //改成您自己的上传接口
                ,accept: 'file' //普通文件
                ,done: function(data){
                    $('#sys_img<?php echo $i;?>').val(data.msg);
                    layer.msg('上传成功');
                    // console.log(data.msg);
                },

            });
        <?php }?>


    })
</script>